From 8ff660d134cd87ac9ac51e10d49c103c4cf47ead Mon Sep 17 00:00:00 2001 From: tsteven4 Date: Mon, 18 Jun 2018 12:33:57 -0600 Subject: [PATCH] improve travis docker script. (#199) --- tools/travis_script_linux_docker | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tools/travis_script_linux_docker b/tools/travis_script_linux_docker index 22ec02a8c..5ce300575 100755 --- a/tools/travis_script_linux_docker +++ b/tools/travis_script_linux_docker @@ -3,11 +3,18 @@ # setup up and run a docker build. # this is used by travis. # -# create the container to run the build and regression. +# run the build and regression in a newly created container. # pass the compiler from the travis matrix through CC, CXX. # we need the default charmap to be UTF-8 for test_encoding_utf8, explicit set it here through LC_ALL. -cnt=$(docker create -v `pwd`:/app -e CC=$CC -e CXX=$CXX -e LC_ALL=C.UTF-8 tsteven4/gpsbabel_build_environment bash -c "./build_and_test") -# copy the pwd to the container. travis has got the code user test in the pwd. -docker cp . $cnt:/app -# run the container to execute the build and the regression. -docker start -a $cnt +# travis has got the code to test in the pwd. +docker run \ +--rm \ +--mount type=bind,source="$(pwd)",target=/app \ +--env CC=$CC \ +--env CXX=$CXX \ +--env LC_ALL=C.UTF-8 \ +--mount type=bind,source=/etc/passwd,target=/etc/passwd,readonly \ +--mount type=bind,source=/etc/group,target=/etc/group,readonly \ +--user "$(id -u):$(id -g)" \ +tsteven4/gpsbabel_build_environment \ +bash -c "./build_and_test" -- 2.30.2